//
//  GAKKIBaseAlertController.m
//  GANGAIKit
//
//  Created by fh on 2019/11/15.
//  Copyright © 2019 cashchina. All rights reserved.
//

#import "GAKKIBaseAlertController.h"

@interface GAKKIBaseAlertController ()

@end

@implementation GAKKIBaseAlertController

- (void)dealloc {
    if (kDebugViewControllerRelease) {
        DBLog(@"\n ~~~~~~+++++++ 控制器 %@ 销毁了 +++++++~~~~~~ \n",[self class])
    }
}

#pragma mark - Public
+ (GAKKIBaseAlertController *)gg_makeAlertControllerWithTitle:(NSString *)title message:(NSString *)massage style:(UIAlertControllerStyle)preferredStyle primaryAlertController:(void (^)(GAKKIBaseAlertController *))block {
    
    GAKKIBaseAlertController *alertVC = [GAKKIBaseAlertController alertControllerWithTitle:title message:massage preferredStyle:preferredStyle];
    if (block) {
        block(alertVC);
    }
    return alertVC;
}
- (AddCustomAction)addAction {
    return ^(NSString* actionTitle, UIAlertActionStyle actionStyle, ActionHandler actionHandler) {
        UIAlertAction *action = [UIAlertAction actionWithTitle:actionTitle style:actionStyle handler:actionHandler];
        [self addAction:action];
        return self;
    };
}
- (AddTextFieldAction)addTextField {
    return ^(TextFieldHandler textFieldAction) {
        [self addTextFieldWithConfigurationHandler:textFieldAction];
        return self;
    };
}

@end
